home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / blankery / mblank / mblank.install < prev    next >
Text File  |  1982-08-01  |  7KB  |  251 lines

  1. ;$VER: MBlank.install 1.22 (28-02-1997) damian@cybercomm.nl
  2.  
  3. ;-constants/vars
  4. (set #date "28-02-1997")
  5. (set #version "1.22")
  6. (set MBlankDir "Select a path:")
  7. (set @default-dest MBlankDir)
  8.  
  9. ;------------------------------ Procedures -----------------------------------
  10.  
  11. ;-make new drawer: MBlank in chosen path
  12. ;-copy files to destinations
  13. (procedure P_Copy 
  14.     (makedir #mbpath (infos))
  15.     (makedir #mbpathmods (infos))
  16.     (makedir #mbpathdocs)
  17.     (makedir #mbpathdev)
  18.     (tooltype
  19.         (dest "MBlank.exe")
  20.         (settooltype "MODPATH")
  21.     )
  22.     (tooltype
  23.         (dest "MBlank.exe")
  24.         (settooltype "MODPATH" #mbpathmods)
  25.     )
  26.     (set #prefspath (tackon #mbpath "MBlank.prefs"))
  27.     (tooltype
  28.         (dest "MBlank.exe")
  29.         (settooltype "PREFS" #prefspath)
  30.     )
  31.     (copyfiles    (source "MBlank.exe")
  32.             (newname "MBlank")
  33.             (dest #exepath)
  34.             (infos)
  35.     )
  36.     (copyfiles    (source "")
  37.             (dest #mbpath)
  38.             (pattern "MBlank.(guide|readme|prefs)")
  39.             (infos)
  40.     )
  41.     (copyfiles    (source "")
  42.             (dest #mbpathmods)
  43.             (pattern "#?.blm")
  44.             (infos)
  45.     )
  46.     (copyfiles    (source "")
  47.             (dest #mbpathdev)
  48.             (pattern "(Forces.blm.asm|module.i)")
  49.     )
  50.     (copyfiles    (source "")
  51.             (dest #mbpathdocs)
  52.             (pattern "#?.blm.guide")
  53.     )
  54.  
  55. )
  56.  
  57. ;-clean up source-files if user approves
  58. (procedure P_Cleanup
  59.     (if (=    (askbool
  60.         (prompt "\nDo you want the source-directory\ncleaned up??")
  61.         (help "YES:\nWill delete all files out of the\nMBlank.lha archive, which were copied.\n\nNO:\nWill not delete...") ) 1)
  62.         (
  63.          (delete "MBlank.exe" (infos))
  64.          (delete "MBlank.(install|guide|readme|prefs)" (infos))
  65.          (delete "#?.blm" (infos))
  66.          (delete "(Forces.blm.asm|module.i)")
  67.          (delete "#?.blm.guide")
  68.         )
  69.     )
  70. )
  71. ;-done
  72.  
  73. ;-choose destination path
  74. (procedure P_DestPath
  75.     (until    (=    (exists MBlankDir (noreq)) 2)
  76.         (set MBlankDir
  77.             (askdir
  78.                 (prompt "Where do you want to install MBlank?\nA new drawer called MBlank will be created there.")
  79.                 (help "\n Choose a path.")
  80.                 (default "Select a path:")
  81.             )  
  82.         )
  83.     )
  84.     (set @default-dest MBlankDir)
  85.     (set #mbpath (tackon MBlankDir "MBlank/"))
  86.     (set #mbpathmods (tackon #mbpath "MB_Modules/"))
  87.     (set #mbpathdocs (tackon #mbpath "MB_Docs/"))
  88.     (set #mbpathdev (tackon #mbpath "MB_Develop/"))
  89.     )
  90.  
  91. ;-check if allready exists, if so provide escape
  92. (procedure P_Exists
  93.     (if    (=    (exists #mbpath (noreq)) 2)
  94.         (if (<> (askbool
  95.             (prompt "\n"#mbpath"\nallready exists, continue anyway?")
  96.             (help "YES:\nThe existing 'MBlank' drawer will be\nerased first.\n\nNO:\nAbort installation procedure.")
  97.             ) 1)
  98.             (exit "\nReport any problems with this script to:\n\ndamian@cybercomm.nl (subject: MBlank)" (quiet))
  99.             (
  100.              (delete (tackon MBlankDir "MBlank") (all) (infos))
  101.              (if (exists "SYS:WBStartup/MBlank" (noreq))
  102.                 (delete "SYS:WBStartup/MBlank" (infos))
  103.                 (if (exists "SYS:WBStartup/WBStartup (Enabled)/MBlank" (noreq))
  104.                     (delete "SYS:WBStartup/WBStartup (Enabled)/MBlank" (infos))
  105.                  )
  106.              )
  107.             )
  108.         )
  109.     )
  110. )
  111.  
  112. ;-ask whether executable should be installed in WBStartup or not
  113. (procedure P_WBStartup
  114.     (if (exists "SYS:WBStartup")
  115.         (set #exeinwbs (askbool
  116.                     (prompt "\nDo you want to install the MBlank executable\nin your 'WBStartup' drawer?\n\n(WBStartup+ users no worries, see HELP...)")
  117.                     (help "YES:\nThe installer will copy the executable to your 'WBStartup' drawer. If 'WBStartup (Enabled)' is present, MBlank will be copied there.\n\nNO:\nMBlank executable will be copied to '"#mbpath"'.")
  118.                 )
  119.         )
  120.     )
  121. ;-if previous answered with YES, set executable path to WBStartup,
  122. ;-but if 'WBStartup/WBStartup (Enabled)' exists, adapt
  123.     (if (= #exeinwbs 1)
  124.         (if (= (exists "SYS:WBStartup/WBStartup (Enabled)" (noreq) ) 2)
  125.             (set #exepath "SYS:WBStartup/WBStartup (Enabled)")
  126.             (set #exepath "SYS:WBStartup")
  127.         )
  128.         (set #exepath #mbpath)
  129.     )
  130. )
  131.  
  132. ;-alter tooltypes to suit user's needs, experts only
  133. (procedure P_Tooltypes
  134.     (
  135.         (set #seconds    (asknumber
  136.                     (prompt "\nHow many seconds before blanking?")
  137.                     (help "Use values between 1 and 2000 seconds.")
  138.                     (range 1 2000)
  139.                     (default 180)
  140.                 )
  141.         )
  142.         (tooltype
  143.             (dest "MBlank.exe")
  144.             (settooltype "SECONDS" (cat #seconds))
  145.         )
  146.         (if    (= @user-level 2)
  147.             (complete 35)
  148.             (complete 55)
  149.         )
  150.         (if (=    (askbool
  151.             (prompt "\nDo you want the MBlank window\nto popup at program-startup?")
  152.             (help "\nYES:\nMBlank's window will popup when you start the program.\n\nNO:\nMBlank will startup without notification.") ) 1)
  153.             (tooltype
  154.                 (dest "MBlank.exe")
  155.                 (settooltype "CX_POPUP" "YES")
  156.             )
  157.             (tooltype
  158.                 (dest "MBlank.exe")
  159.                 (settooltype "CX_POPUP" "NO")
  160.             )
  161.         )
  162.         (if    (= @user-level 2)
  163.             (complete 40)
  164.         )
  165.     )
  166.     (if    (= @user-level 2)
  167.         (
  168.             (if (=    (askbool
  169.                 (prompt "\nDo you want blanking to be reset\nby a mouse-move? (not press!)")
  170.                 (help "\n  No help for experts!") ) 1)
  171.                 (tooltype
  172.                     (dest "MBlank.exe")
  173.                     (settooltype "MOUSETRIG" "YES")
  174.                 )
  175.                 (tooltype
  176.                     (dest "MBlank.exe")
  177.                     (settooltype "MOUSETRIG" "NO")
  178.                 )
  179.             )
  180.             (complete 50)
  181.             (if (=    (askbool
  182.                         (prompt "\nDo you want blanking to be reset\nby a disk-insert/removal?")
  183.                         (help "\n  No help for experts!") ) 1)
  184.                 (tooltype
  185.                     (dest "MBlank.exe")
  186.                     (settooltype "DISKTRIG" "YES")
  187.                 )
  188.                 (tooltype
  189.                     (dest "MBlank.exe")
  190.                     (settooltype "DISKTRIG" "NO")
  191.                 )
  192.             )
  193.             (complete 60)
  194.             (if (=    (askbool
  195.                 (prompt "\nDo you want MBlank to add a menu-item\nto WorkBench's Tools menu?\n\nPicking this item will activate blanking\nafter a short 'release mouse first' delay.")
  196.                 (help "\n  No help for experts!") ) 1)
  197.                 (tooltype
  198.                     (dest "MBlank.exe")
  199.                     (settooltype "MENU" "YES")
  200.                 )
  201.                 (tooltype
  202.                     (dest "MBlank.exe")
  203.                     (settooltype "MENU" "NO")
  204.                 )
  205.             )
  206.             (complete 70)
  207.             (if (=    (askbool
  208.                         (prompt "\nDo you want multiple modules\nto alternate at random?")
  209.                         (help "\n  No help for experts!") ) 1)
  210.                 (tooltype
  211.                     (dest "MBlank.exe")
  212.                     (settooltype "RANDOM" "YES")
  213.                 )
  214.                 (tooltype
  215.                     (dest "MBlank.exe")
  216.                     (settooltype "RANDOM" "NO")
  217.                 )
  218.             )
  219.         )
  220.     )
  221. )
  222.  
  223. ;-show the statistics and ask for approval
  224. ;-nothing was actually done sofar, so cleanup on abort is not needed
  225. (procedure P_StatCopy
  226.     (if    (=    (askbool
  227.                 (prompt "\n* The destinations *\n\nFiles: "#mbpath"\nExecutable: "#exepath)
  228.                 (help "Proceed:\nThis is like it is.\n\nCancel:\nAbort installer now.")
  229.                 (choices "Proceed" "Cancel") ) 1)
  230.         (P_Copy)
  231.         (exit "\nReport any problems with this script to:\n\ndamian@cybercomm.nl (subject: MBlank)" (quiet))
  232.     )
  233. )
  234.  
  235. ;----------------------------------- Main ------------------------------------
  236.  
  237. (welcome "\nThis script will install MBlank "#version",\n"#date", damian@cybercomm.nl")
  238. (P_DestPath)
  239. (complete 10)
  240. (P_Exists)
  241. (complete 20)
  242. (P_WBStartup)
  243. (complete 30)
  244. (P_Tooltypes)
  245. (complete 80)
  246. (P_StatCopy)
  247. (complete 90)
  248. (P_Cleanup)
  249. (complete 100)
  250. (exit " \nThank you very much for installing\nMBlank "#version" ("#date") to\n"MBlankDir"\n\nIf you have any problems with the program,\nfeel free to contact me via e-mail.\n\ndamian@cybercomm.nl\nhttp://www.cybercomm.nl/~damian" (quiet))
  251.